﻿package code 
{
	
	import flash.display.SimpleButton;
	import flash.events.*;
	
	/*
	GenericButton.as
	Handles the click event for GenericButton
	@author Brandon Littell
	*/
	public class GenericButton extends SimpleButton 
	{
		
		/*
		Constructor
		*/
		public function GenericButton() 
		{
			// constructor code
			addEventListener(MouseEvent.CLICK, OnClick);
			addEventListener(Event.REMOVED_FROM_STAGE, RemovedFromStage);
		}
		
		/*
		Removes event listeners when the button is removed from the stage
		*/
		public function RemovedFromStage(e:Event):void
		{ 
			removeEventListener(MouseEvent.CLICK, OnClick);
			removeEventListener(Event.REMOVED_FROM_STAGE, RemovedFromStage);
		}
		
		/*
		Handles what happens when this button is clicked
		*/
		public function OnClick(e:MouseEvent):void
		{
			trace("Generic Button Clicked");
		}
	}
	
}